<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
        
</head>
<body>
    <!-- 准备好一个容器 -->
    <div id="root">
        <h2>欢迎来到{{name}}</h2>
        <!-- <button v-on:click="showInfo">点我提示信息</button> -->
        <button @click="showInfo1">点我提示信息1(不传参)</button>
        <button @click="showInfo2(66, $event)">点我提示信息2(传参)</button>

    </div>
</body>
<script type="text/javascript">
    Vue.config.productionTip = false //阻止 vue 在启动时生成产生提示
   
    new Vue({
        el: '#root',
        data: {
            name: '西安文理'
        },
        methods: {
            showInfo1(event){
                alert('同学，你好！')
            },
            showInfo2(number, event){
                console.log(number, event);
                alert('同学，你好！!')
            }
        }
    })
</script>
</html>